
import ast
from misc.utils import convert_value

def convert(data_map, export):
    result_data = data_map.copy()
    for key, value in result_data.items():
        value_type = value["type"]
        value_export = value["export"]
        if value_export != "cs" and value_export != export:
            continue
        value["value"] =  convert_value(value["value"], value_type)
    return result_data